<?php

        $con = mysql_connect("5580d2e52281a.sh.cdb.myqcloud.com", "jlHotel", "jlHotel01035655") or die;
        mysql_select_db("jlHotel", $con);
        mysql_query("SET NAMES UTF8");


		$postStr = file_get_contents("php://input");
        $array = (array)simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);

        
        
        $openid = $array['openid'];
        // $total_fee = $array['total_fee'];
        $attach = explode(',', $array['attach']);
        $map['wx_orderid'] = $array['transaction_id'];
        $map['pay_time'] = time();
        if ($array['result_code'] == 'SUCCESS' && $array['return_code'] == 'SUCCESS') {
            
            //保存订单数据
            $userid = M('wxuser')->where(array('openid'=>$openid))->getField('id');
            $map['order_status'] = 1;
            $ss['userid'] = $userid;
            $ss['wx_orderid'] = null;
            file_put_contents('test.text',$map);
            M('order_room_result')->where($ss)->save($map);
             
        }